package com.dianqiu.common.bean;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import com.dianqiu.base.bean.BaseTO;

/**
 * DqMatch entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "dq_match", catalog = "dq_dev")
public class DqMatchTO extends BaseTO implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer mthId;
	private DqCodeTblTO dqCodeTblByMthStatusCd;
	private DqClubsTO dqClubsByHomeClbId;
	private DqCodeTblTO dqCodeTblByWeathCd;
	private DqLeaguesTO dqLeagues;
	private DqClubsTO dqClubsByAwayClbId;
	private Timestamp mthDate;
	private Integer homeScore;
	private Integer awayScore;
	//add by david begin
	private String matchDate;
	private String matchTime;
	@Transient 
	public String getMatchDate() {
		return matchDate;
	}

	public void setMatchDate(String matchDate) {
		this.matchDate = matchDate;
	}
	@Transient 
	public String getMatchTime() {
		return matchTime;
	}

	public void setMatchTime(String matchTime) {
		this.matchTime = matchTime;
	}
	//add by david end
	private Set<DqBetUserMatchTO> dqBetUserMatchs = new HashSet<DqBetUserMatchTO>(0);
	private Set<DqMatchPoolTO> dqMatchPools = new HashSet<DqMatchPoolTO>(0);
	private Set<DqHandicapTO> dqHandicaps = new HashSet<DqHandicapTO>(0);

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "MTH_ID", unique = true, nullable = false)
	public Integer getMthId() {
		return this.mthId;
	}

	public void setMthId(Integer mthId) {
		this.mthId = mthId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MTH_STATUS_CD")
	public DqCodeTblTO getDqCodeTblByMthStatusCd() {
		return this.dqCodeTblByMthStatusCd;
	}

	public void setDqCodeTblByMthStatusCd(DqCodeTblTO dqCodeTblByMthStatusCd) {
		this.dqCodeTblByMthStatusCd = dqCodeTblByMthStatusCd;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "HOME_CLB_ID", nullable = false)
	public DqClubsTO getDqClubsByHomeClbId() {
		return this.dqClubsByHomeClbId;
	}

	public void setDqClubsByHomeClbId(DqClubsTO dqClubsByHomeClbId) {
		this.dqClubsByHomeClbId = dqClubsByHomeClbId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "WEATH_CD")
	public DqCodeTblTO getDqCodeTblByWeathCd() {
		return this.dqCodeTblByWeathCd;
	}

	public void setDqCodeTblByWeathCd(DqCodeTblTO dqCodeTblByWeathCd) {
		this.dqCodeTblByWeathCd = dqCodeTblByWeathCd;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "LG_ID", nullable = false)
	public DqLeaguesTO getDqLeagues() {
		return this.dqLeagues;
	}

	public void setDqLeagues(DqLeaguesTO dqLeagues) {
		this.dqLeagues = dqLeagues;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AWAY_CLB_ID", nullable = false)
	public DqClubsTO getDqClubsByAwayClbId() {
		return this.dqClubsByAwayClbId;
	}

	public void setDqClubsByAwayClbId(DqClubsTO dqClubsByAwayClbId) {
		this.dqClubsByAwayClbId = dqClubsByAwayClbId;
	}

	@Column(name = "MTH_DATE", nullable = false, length = 19)
	public Timestamp getMthDate() {
		return this.mthDate;
	}

	public void setMthDate(Timestamp mthDate) {
		this.mthDate = mthDate;
	}

	@Column(name = "HOME_SCORE")
	public Integer getHomeScore() {
		return this.homeScore;
	}

	public void setHomeScore(Integer homeScore) {
		this.homeScore = homeScore;
	}

	@Column(name = "AWAY_SCORE")
	public Integer getAwayScore() {
		return this.awayScore;
	}

	public void setAwayScore(Integer awayScore) {
		this.awayScore = awayScore;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqMatch")
	public Set<DqBetUserMatchTO> getDqBetUserMatchs() {
		return this.dqBetUserMatchs;
	}

	public void setDqBetUserMatchs(Set<DqBetUserMatchTO> dqBetUserMatchs) {
		this.dqBetUserMatchs = dqBetUserMatchs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqMatch")
	public Set<DqMatchPoolTO> getDqMatchPools() {
		return this.dqMatchPools;
	}

	public void setDqMatchPools(Set<DqMatchPoolTO> dqMatchPools) {
		this.dqMatchPools = dqMatchPools;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqMatch")
	public Set<DqHandicapTO> getDqHandicaps() {
		return this.dqHandicaps;
	}

	public void setDqHandicaps(Set<DqHandicapTO> dqHandicaps) {
		this.dqHandicaps = dqHandicaps;
	}

}